<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
	<title>Lista de Setores</title>
</h:head>
<h:body>

<h:form>  
    <p:growl id="messages"/>
    <p:menubar>
            <p:submenu label="Cadastro" url="index.jsf" icon="ui-icon-contact">
            <p:menuitem value="Refrigeradores" url="listar_Refrigerador.jsf"/>
            <p:menuitem value="Grupo de Defeitos" url= "listar_Grupo_Defeito.jsf"/>
            <p:menuitem value="Setor" url= "listar_Setor.jsf"/>
            </p:submenu>
            
        <p:submenu label="Relatório" icon="ui-icon-pencil">
            <p:menuitem value="Gráfico" url="#" />
            <p:menuitem value="Exportar" url="#" />
        </p:submenu>
 
        <p:submenu label="Ajuda" icon="ui-icon-help">
            <p:menuitem value="Manual" url="#" />
            <p:menuitem value="Sobre o Projeto QI" url="http://www.weysolucoes.com.br/servicos.php" />
        </p:submenu>
 
        <f:facet name="options">
            <p:commandButton type="button" value="Sair" icon="ui-icon-extlink" />
        </f:facet>
    </p:menubar>
</h:form>

	<h:form>
		<p:dataTable var="setor" value="#{SetorMB.listarSetores}" >
		
			<p:column headerText="Id">
				<h:outputText value="#{setor.idSetor}" />
			</p:column>
			
			<p:column headerText="Nome do Setor">
				<h:outputText value="#{setor.nomeSetor}" />
			</p:column>
			<p:column headerText="Ação" colspan="1">
				<h:commandButton action="editar_Setor" actionListener="#{SetorMB.sel}" value="Editar"></h:commandButton>
                <h:commandButton action="#{SetorMB.deletarSetor}" actionListener="#{SetorMB.sel}" value="Apagar"></h:commandButton>
			</p:column>
		</p:dataTable>
		<br></br>
		<p:button outcome="cadastro_Setor.jsf" value="Cadastrar" icon="ui-icon-star" alt="Novo Cadastro"/>
	</h:form>

</h:body>
</html>